from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template

from django.contrib import admin
admin.autodiscover()

# Case 1
#from djangostudy.views import helloworld, sayhello, current_datetime, hours_ahead
#urlpatterns = patterns('',
#	(r'^helloworld/$', helloworld),
#	(r'^sayhello/(\w*)/$', sayhello),
#	(r'^time/$', current_datetime),
#	(r'^time/plus/(\d{1,2})/$', hours_ahead),
#	(r'^admin/', include('django.contrib.admin.urls')),
#)

# Case 2
#urlpatterns = patterns('djangostudy.views',
#	(r'^$', 'index'),
#	(r'^helloworld/$', 'helloworld'),
#	(r'^sayhello/(\w*)/$', 'sayhello'),
#	(r'^time/$', 'current_datetime'),
#	(r'^time/plus/(\d{1,2})/$', 'hours_ahead'),
#	(r'^foo/$', 'foobar_view', {'url':'foo'}),
#	(r'^bar/$', 'foobar_view', {'url':'bar'}),
#	(r'^admin/', include('django.contrib.admin.urls')),
#)

# Case 3
#urlpatterns = patterns('',
#	(r'^helloworld/$', 'djangostudy.views.helloworld'),
#	(r'^sayhello/(\w*)/$', 'djangostudy.views.sayhello'),
#	(r'^time/$', 'djangostudy.views.current_datetime'),
#	(r'^time/plus/(\d{1,2})/$', 'djangostudy.views.hours_ahead'),
#	(r'^admin/', include('django.contrib.admin.urls')),
#)

# Case 4
urlpatterns = patterns('djangostudy.views',
	(r'^$', 'index'),
	(r'^helloworld/$', 'helloworld'),
	(r'^sayhello/(\w*)/$', 'sayhello'),
	(r'^time/$', 'current_datetime'),
	(r'^time/plus/(\d{1,2})/$', 'hours_ahead'),
	(r'^foo/$', 'foobar_view', {'url':'foo'}),
	(r'^bar/$', 'foobar_view', {'url':'bar'}),
)
urlpatterns += patterns('',
	#(r'^admin/', include('django.contrib.admin.urls')),
	(r'^admin/', include(admin.site.urls)),
	(r'^blog/', include('blog.urls')),
	(r'^book/', include('books.urls')),
)

